fixed require for 3.0+ rails, added lazy loading