Same PR as accepted PR #209 for develop branch

Hi @avalanche,

Actually this is same PR as accepted PR https://github.com/avalanche123/Imagine/pull/209 for develop branch.
On this way I would like to speed up process of transferring of fix done through PR https://github.com/avalanche123/Imagine/pull/209 with master branch.

Regards!