printing errors to debug log