adding  logic added