Fixed freezing issues