add function after refresh