Added logging in case of errors.