layer retain bug fixed