Bug fix and add datetime type