The previous code had a condition where it was using the wrong variable, thus was impossible to reach.