Handling $HOME directory changes gracefully