fixed null pointer dereference in self-capturing closures