Corrected error in path build function