more secure input handling