fix freeze problem