Adding size check to array