fixing command parsing and handling