Fix NullpointException problem in on MenuItemSelected