Sometimes the resources loaded before events.js was included. Fixed.