fix first run bugs