Add code for constant polling of database and fix charts