fix clear and compact