fixed segmentation fault after enter press when no item of menu chosen