changing log to an exception