handle startup correctly