added support to set token directly