fix parsing of incoming commands