better error handling for non-numeric inputs