added refresh token & error handling