added some logic 2