Added check before unserializing to ensure that the string is not empty.