Updating save query, adding deletion logic