fix bugs and clear FO