Fixed bug with 'datetime' type in database