restore last_error method, got snipped