change database connection to persistent connection, model logic change