Ensure 'this' is properly set in callbacks