Adding ajax functionality