fixed range constraint bug