add case then index starts from 0