adds edit and view functionality