Changes for proper insertion of State attribute in db