fixed device.c