fix bug with db