error handling changes