Fixed bug in event binding.