- added error logging