updated insertState