Fix infinite loop in last method implemented