empty string checking added