updated script for safe compile
