Fixed cleanUI state check