modifying scripts task preventing from infinity looping