changed error logging