Handle the device width changing