improved the update method in admin class