fix the crash on creating menu