fixed sloppy var checking, resulting in php notice warnings.