implemented offset method for index queries