called checkfullandempty in set-data method