Make sure callback is of right type