Added check for numbers outside of range