Fixed bug with loading secondary layers