fixed views to work with the new database