Swarm not working - Client is newer than server

Hey,

I was trying to deploy a docker swarm cluster. I was able to create a swarm cluster of two nodes, one being the manager and the other a join node. I was also able to access the docker images on the join node at the manager node and was able to start them. But when I issue a docker run command with -it or when i try to stop a container on the other node, it shows an error saying Client is newer than server.

Before I start the swarm manager, I found that the client and server versions are the same.

$ docker version
Client:
Version: 1.12.0
API Version: 1.24
Go version: go1.6.3
Git commit: b9264d4
Built:
OS/Arch: linux/amd64

Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: b9264d4
Built:
OS/Arch: linux/amd64

However after starting the swarm manager, when I issue the docker version command, I get the output as:

$ docker version
Client:
Version: 1.12.0
API Version: 1.24
Go version: go1.6.3
Git commit: b9264d4
Built:
OS/Arch: linux/amd64

Server:
Version: swarm/1.2.5
API version: 1.22
Go version: go1.6.3
Git commit: b9264d4
Built:
OS/Arch: linux/amd64

But still the cluster was formed and I issued a run command with -it. Then an error was thrown and the system halted.

$ docker run -it ubuntu:12.04
client is newer than server (client API version: 1.24, server API version: 1.22)

Is it a problem with the swarm image I am using? I have downloaded the latest swarm image.
Could someone help me out with this?