Fix multiple javascript event attachments