Debugged Duplicate key issue in dict