fixing mongoid error