handle vertical paths correctly