fixed recursive import issues and added more logging