Fix freezing issue.