changing login code to allow null name or id