check integer rather than catching exceptions