return to command mode when focus is lost