new version - fix a bug