fixed command queue for self-inserting functions