isEmpty method added