update: better error logging