Added logic in script conditions