fix logging and catching exceptions AS IVAN WANTED )))