added method isEmpty