Added code to server function.