added positive number validation
fixed error handling