fixed issue where token got lost