change to use string instead of int for mode