fixed bug for update