Added error handling to PublicApp