removed exec and close from constructor