fix bug in InRange
update singleton