few changes in function update