patch changes for handling of token