more secure compile method