fixed bug converting string to int