updated to work with mac