added exception handling and start on logging