attempt to move delete method JavaScript to helper - failed