add more tests and fix overwrite in dictionary