transaction support + better error logging.