fixed seg fault in test pop