use empty method instead of isEmpty