Fix bug in On command