nit: log error check