logging in case of error