fix when receiving token in constructor