Made changes to make listeners work.