finish the function stack_pop