slightly improve logging, to not log in case of errors