better error handling on getLong
added isLong