fixed UI not updating properly