fixed freeze problem