changed events.js and moved js load to end of body