Bugfix in query view and adddevice javascript