fixed if condition since it was causing a notice to show up