fixing Array bugs