Keep state in closure