Fixed bug with reset