Adding user defined callback functionality