removed major bug in task listing tree and updated the condition