fixed crash bug

moved key definitions after mode definition. Can't define keys in the mode's mode map otherwise.