added main condition