fixed synchronization bug while clearing memory