fix another edge case where the menu was shown unexpectedly