helper function update