Get script to start working

Change-Id: I64dead33d7c76741559eddddb51fdcb5f9c15f05
Fix issues with script repeating itself

Change-Id: I2f38c335a70651bab833a694238f9e8a2938ec66