Added more detailed logging