Crude fix for memory leak