fixed  bugs in handling arrays