fix cd completion error and remove grep/sgrep function