Disable automatically rearrange Spaces based on recent use

Mission Control gives you access to all your open windows and desktops (spaces). The spaces are automatically sorted by recent use, you can undo this.Use the following command in Terminal to change this.

defaults write com.apple.dock mru-spaces -bool false