fix callback function
work in progress