only update layers if they are present