add function reset and fixing bug for empty line