fixing problem 644
Merge pull request #645 from ifilippov/636

fixing problem 644