fixed isset usage; added debugging