minor changes to correct flow