fixing wrap conditional