avoiding headless exception