copy previous logic