Adding data() method to access global variable