Fixes bug where multiple tokens can be created for the same prompt