need to make sure connection is open before attempting to create script history table