added debug messages to investigate analysis_type issue