fixed warning of not used variable
fixed strtoul error, errno instead