add functions isempty and checkvalue