fix bugs with firstrun and nginx