fixed refresh bug, changed the way tokens are handled.