Wrap command in try except