added getDocumentsDirectoryPath method. Fixed crash when sending nil values to errorWithCode method