Implement serialization / Add null check