fixed possible memory leak