small bug fixed for returning Nothing when the array is size 0.