fix db connect in stage