fixed readCmd() on empty input