updated for mongoid