fixes an issue with directory added twice to in appendURL