added functionality to complete tasks