fix wrong sql
fix wrong accessor for hash values, and wrong html
fix typo
fix bugs