fixing shadowing of 'self'