add coner case (when array is full)