add db function and review performance from user