modify callback for more generic support