added ajax view function