fixing command ordering