fixed memory issues in windows