fix bug related to clearing cache