added debug log to save