@mahagr can you check : >=$this->config->max_links +1 
he isn't taking the right number, so I added +1. Then its ok