added simple conditional for dict creation