implement command insert-remove flow

fix command queue issues