updated profile page logic