updated cleanup sql procedures