Permission denied when trying to pull fabric images

I am trying to install hyperledger fabric on my ubuntu machine and have followed all the steps with success except the last one, when using curl command to pull fabric images I get permission denied while trying to connect to docker daemon at unix. I have run the same command using sudo and still the problem persists. Any advice?

I have solved the error it seems all that was needed was a restart I think to effect a path change as after restarting the machine and running the same code it worked.