implement device loop