Returning an empty array when there's an error