Add proper function check for callback