listener rewrite