CD into the parent of the script before executing a function