fixed #5, detect whether dot exists or not.