Fixed freeze bug