getting a range violation here