Added logging in case of exceptions
Added logging in case of exceptions