Added increased validation to both the agent and server