function reset added to constructor