Replace now undefined pop method with other logic