corrected a little memory leak