more robust path creation