modify changes according to the comments given in the pull request 791