Fixed device name bug in script.