chap3 fixing with db