bugfix in prepare script