delete function used instead of undef for removing hash elements