Attempt to fix the freezing bug.