fix for pop method