fixed viewProfile function