bef merge
logic added