fixing device register logic