Secured delete function