cast string to int for mode