Modify the securityListener and add some unit Test