fixed bug in RegisterListener