Undefined $self variable in closure

Change-Id: I8ad5a5c43d16965480db78b2dc1d605f61aadd88