Fixed error there string parameters were used after the function call had ended.