add check hash for empty http://www.perlmonks.org/?node_id=173677