add pre command hook