add needed line after update and simplify