add some error handling for statuses and some errors