add layer detection; fix broken texture