Correct parsing URL, update directories