changing script to get the home directory