fix syntax error in ASAppdelegate.m & fix detection recursive call