got rid of a some excess and fixed a bug

there was a bug were if the user typed just a mode with out a commandm caused a segmentation fault