fix errors when range is disabled