fix some lifetime issues