make date picker work, fix bugs