fix date optimizer bug

should detect existing of w1 first