Fix for background thread in listener