fixed bug in createLayerPoints for deleting before insert.