don't raise exception when input is not an array, return correct error