updated posting system to use the database