fixed freeze bug