more secure path handling