These 3 lines are useless if $forcedType is used. Use if statement instead of the setType