fix a bug with flash