fixed bug in reset