use logging rather than 'print with stderr'