fixed when array is cleared