new version for fixed code