bug fix for cloning