Created a function to check is empty or set, and serialize and unserialize arrays