solution for:.has_key() is deprecated, use 'in'