Fixes #471

It may have some side effect. Seems working fine for me

Please look at issue comments