add couch1.5 compatible code