Added function to load data and click handling