bluetooth module issue with UNO

Hi, my bluetooth module runs fine with duemilanove, but with the same wiring and sketch, it somehow didn't run properly on UNO. I can send text to the bluetooth, but it doesn't seem to response my input command. My sketch is simply a led switch.

char val;         // variable to receive data from the serial port
int ledpin = 4;  // LED connected to pin 2 (on-board LED)

void setup()
{
  pinMode(ledpin, OUTPUT);  // pin 13 (on-board LED) as OUTPUT

  Serial.begin(9600);       // start serial communication at 115200bps
  Serial.println("Enter");
}

void loop() {
  if( Serial.available() )       // if data is available to read
  {;}
    val = Serial.read();         // read it and store it in 'val'
  
  if( val == '0' )               // if '0' was received led 13 is switched off

  {
   digitalWrite(ledpin, LOW);    // turn Off pin 13 off
delay(1000);                  // waits for a second  
Serial.println("Pin 4 : off");
  }

if( val == '1' )               // if '1' was received led 13 on
 {
    digitalWrite(ledpin, HIGH);  // turn ON pin 13 on
    delay(1000);                  // waits for a second
    Serial.println("Pin 4 : on");
  }
  
}
  if( Serial.available() )       // if data is available to read
  {;}

If there is serial data to read, do nothing. If not, do nothing. Why bother?

By the way, Serial.available() returns the number of bytes available to read, not true or false. Don't code it like it returns true or false if you want your code to really be readable.

    val = Serial.read();         // read it and store it in 'val'

Then, regardless of whether there is data to read, or not, read some. Wrong!