memory leak kinda fixed (NOT REALLY)