fixed bugs
added date to db insert