error handling changes after testing