added more log statements for debugging