Fixing #31 php notice

## Ready State yes
Adding in some basic sanity checks to the IF statements so the php doesn't throw notices about undefined properties