Fix Undefined method save() for StdClass error