modified dispatch function to handle GET parameters