Adding function to get data