view function fix, register returns token