finish install database function