Add logic for pending states