Added catching for integer conversion error