Pay attention to closures when registering functions