Change null value for idx to be -1