fixed more stuff (check if files and dirs exist etc.)