added better error logging to data module