fixed device edit and adding bugs.