Fix bug on reset