diff --git a/tohtml.sh b/tohtml.sh
index 58f2fc1..052b0bf 100644
--- a/tohtml.sh
+++ b/tohtml.sh
@@ -1,4 +1,4 @@
-for char in `ls $1`
+for char in `find $1 -maxdepth 1 -type f`
do
- markdown $1/$char > $1/`echo $char |sed 's/.md$/.html/'`
+ markdown $char > `echo $char |sed 's/.md$/.html/'`
done