fix device equals method