fix refresh token issue Issue #251

Signed off with minor comments