made it stateful