fixed HOME env restoring