fix command error handling