added ValueError catching for string to int converion