added ajax functionlity