bug fix for previous at end of array