Pass StateMachine to guard
Merge pull request #3 from Padam87/guard_fix

Pass StateMachine to guard