bugfix for buildWrap