rewrite event binding functions