BUG: loop problem for mosaic

mosaic was not able to work two times in a row