fixing NameError exception on :delete action