change if cond. better logic