added detailed logging