model and view bug fixes