ADDED error handling
ADDED is null check
CHANGED errorhandling
ADDED extra array check
Merge pull request #12 from SoSocio/AddedErrorHandling

ADDED error handling