Change to work with mongoid