Fix bugs when using menu