Fix crash when menu button is pressed