fixed error causing PHP to fail because of if statement