Javascript for dynamic accept, refuse, delete working