Added more log statements for debugging