exception handling for numeric values