Fixed layout bug for hidden items