duplicate event binding fixed
some minor bugs fixed