add assertion, avoid null pointer