Updated App to close the database connection when showing an error screen.