fix a bug for layer
test invalidate of layer