fix bugs of flow_database