two stages detector