fixed slight memory leak