Fix #395 issue and fix read function
Merge pull request #402 from piotrwalkusz1/dev

Fix #395 issue and fix read function