Fix mongoid error