replaced with current functioning server code