added a lot of database code and working on loading component from db