Wow what a blob of too many coders.

First let me say I have no idea where your code came from as I don't see content_dir being defined anywhere.
But looking at what it is producing try removing the content_dir. from the command whatever it was.
Seeing what your total code is for these routines would be nice since you are following 2 peoples advice.