working save and delete functionality