fix date flow problem