Ensure check_dir enters the e correct directory after creating it (if it does not exist in the first place)