fixed UI freezing bug... I think