Add close method to handle disposing of views.