fix logging. add fetch function