Added more robustness to command.