fix pop method