fixing layering problem