fixed test setup (create target directory if it doesn't exist)