add with_statement to compatible with 2.6