some error logging fix