update for new version and fixed bug