Fix setDate bug