change: implement database related function