bug fixed for generic array