update example code for device lib