Error checking

Now uses try and catch to prevent breaking with null elements
string defaults to empty as opposed to no