mistake in generator. Should fix pop return