add const quantifier to dispatch function