refactors router and delete buttons work now