check before deref
fix test