fixed some bugs, added an toggle= enable/disable semantics