change version to branch name
for some reason, for loop of dir does not always work correct, judge dir to get rid of it