now works properly on mac