pop method working