delete redundancy code about add device