fixes string to int conversion error