Fixed bug introduced when changing from check_folder() to new