Added file_exists check to mkdir()