Added some error handling, testing on OSX _not_ going great :/