It seems this is a known bug and unfortunately the only way to fix it is to change it at runtime as you are doing .