changed build logic regarding cleanup