fixed crashes & further handled type safety when reading from dict