fixed bug in menu when handling resize