improve framedetector