with statement added to all functions