fixed ruby range error