Bug with preserving the correct thread for listening