adds functin after db connection