fixed errors in flow