fixed grep range end