error for improper usage of range operator