works on first try now

added isset checks