Found out the source of range error