fixed full memory problem