"added error handling"