added check for empty headline