foil detection and bottle back up detection