added database functionality and fixed dashboard