add assertion into pop()