fixed and improved last pull request