make number-checking more secure