fix range error for bases