fix delete button, move del function to separate js file