rewrite flee & bug fixes