fixed some pop operations