throw error when data is not a Hash