Adding additional logging for errors.