Add locking to insure that only a single app context gets created