added insert time to database functionality