added fixes for mac and linux