- added error handling