some small improvements
added error logging