added using() statement to deal with closable resources