making the script run in a headless environment