add block logic