added to check to avoid going out of bounds of array