fix is_main condition