add guard for compilation and uglify