bind some event handlers
add stats counter