Fixed broken Visibility switching

now also works inside of if-statements