some fixes related to attaching events & setting values