fixed closure handling