got it to compile by doing weird pointer trickery, but it still crashes on bottle instantiation