Changed != to ==

throwing the exception was wrong.