add assertion and fix docblock