fix a lot of layer transition bug