added fail cases for "" and invalid characters