Added register listeners method.