added ajax functionality