moved device count variable from static to local scope