cleaned up menu exit function