optimize

also with upate atabase