parse int and error handling