Add check for allocation failure of menu buttons