fixing bug with wrapping inner fragments