solve infinite loop in menu