fixed indents and changed TargetNotSupportedException to detect the target automatic