added some conditions