Add data() function in model