fix typos, use 'keys' to iterate over attributes