memory flush added