Fixed device check code issue