added empty hash array check