database finally working