add function to server