added error handling functions