fix issue when script is called multiples times