Fix critical error on first run