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

Pass StateMachine to guard