Fixed weird issue with global state regarding choose function