set handler directly, buggy with jquery