better validation for negative numbers and characters