add attachEvent method