add assertion to check if document actually is nested