Fixed subtle bug caused by state being shared across different requests