moved putdevice to class function