modified methods to throw exceptions and added search command type
solving merge conflicts