fix bug with error logging