fix freeze bug