add callback function to object