Resolving date bug