fix range that starts with a ]