The problem is probably, as vitamin already pointed out, you used the tilde instead of /home/username. The ~ is a shorthand in the shell, but don't expect it to be expanded by other programs. In some cases, you can use $HOME in it's place if you don't want to hardcode the userid.