fix clear completed functionality