Many laws that deal with underage persons are strict liability laws. This means that it doesn't matter what you thought or what you were told. All that matters is the facts - was she below a certain age? It doesn't matter what age you thought she appeared to be. It's like a speeding ticket. It doesn't matter how fast you thought you were going, just whether you were above the stated speed limit. And unlike a traffic ticket, sex crimes involving minors is a topic you want to avoid and never worth the risk.