improved the updating db speed