Updated listener class  a bit.