updated view function

fixed view function to take gender