added callback to retrieve function