partially fixed a latent bug