Made sure script is not run if it didnt compile successfully.