Fixed 'undefined variable' error in profile.php