You might have not mentioned the Layer in the Code, I would suggest give the layers numbers and it should be Sorted.