added mongoid support bug fix