fix range checks on selects