Add protection incase database accidentally close