add view function