fixed bug with level counter update timing