Fixed the client add function