before making db