Bugfix because 0's are falsey so checking for existence of idx param needed tweaking to accommodate that