tasks logic