Fixed stupid logic mistake due to mismatched variable names