fix error in mongoid