cleanup dom events

a small cleanup of dom events, moving iteration var in scope, adding a semi-colon, making a better var name.