fix mac-specific err introduced while shuffling code