proper handling of do statements