updated bug with attach events