get function for device