fixed cast for callback