fixes some error logging