fixing a bug on startup