update the limitFromTo method