rake with state machine