function to get query values from url