updated code but not working for devicestorage