fixing layer sorting when loading tilemaps