Added Test for disposing of statemachine