updated to work with mongoid 4