change to ArrayUtils to check empty array