handle darwin and linux