Added edit command and error catching