add logging if error occurs