change the exception part at determine the app type