made changes to add date and auto create needed table