various bug fixes. token bug :c