fixed error checking ror sub array function input