Addressed Paul's comments: Thread modified to listen for events

Addressed Evgeny's comment:
UI thread should not be blocked