fixed potential array OOB problem where num follows is less than 5