Adding task completed functionality