Added a folder-exists check