implemented review comments fom pull request 1040