added some lose conditions