fixing a very nasty bug - file_exists() doesn't work with ../../ in path names