fix callback functionality