bug fixes for clear