I'd like to think that if you'd been formally warned that your actions were making women  uncomfortable, you'd take the time to wisen up and figure out exactly what you were doing that needed to change. And honestly, if it got to the point that you needed such a warning, uninvited hugs WOULD be inappropriate. This is a pattern of harassment, not a matter of "shaking hands."