adding ajax functiaonlity