Deleting works, javascript needs fixing