added some ajax functionality