fixed comparision
use exception instead of log messages for errors