fix sub document error