fixed build on OS X
added workaround for menu crashes