fix framework detection function