Nav bar tab works for profile view

Changed the javascript