Solved a majour BUG while putting devices offline