making ui responsive and not freeze on long method calls