action listener to clear memory