Will the code ever reach this point? Before this `if` statement you're checking for required keys, so `"study_experimental_factor"` should be included there