update the way to get the directory of extension