Removed unnecessary toArray() invocation