added close method to app

Addresses #489