add ajax functionality