only execute when required directories exist