Fixing issue with preventDefault on menuitem click