added setModality view and functionality