fixing wrong dictonary handling