added logs in case of exceptions