fix "-d" option bug