Added defination of the call back function