Probably there should be
`if (isset($_GET['filter']) && $_GET['filter']!='') {`