Move fsm from stack to free store