fixing command handling