added further logging and testing