trying to fix dictionary matching