implemented check for basename and HOME