Adding conditional mapping so that it works in mac and linux