replaced CheckUpper function