added error handling. apparently safari doesn't like my xhr