finally working db