fixed HOME directory extraction