pass decoder callback by reference