fixed the selecting 0 index issue