switching from document level to database level fixed