placing attachEvents on the prototype