The problem is that you are using a string comparison operator (>). This operator will check if the left-hand-side string is lexicographically greater than the right-hand-side string.
What you instead need to use is the arithmetic comparison operator -gt.
See e.g. here for more information.