add log statements for debugging