Added command error catching