fixing logic in script