added code to handle saving clone definition