handle any errors