solve the jquery event bind problem. unbind before bind to avoid
repeatedly binding.