fixed the database templates and tree view