added offset to queries