fix the latest bug when producing multiple layout for the same package