made changes as per the comments on pull request