fix negative array size