Fixed install script

Changed the way to get the correct value of key_dir.