use q instead of next