ensure username variable is not None before checking if profilephp in it